//
//  NetWork.m
//  ios-test
//
//  Created by Apple -11 on 15/10/15.
//  Copyright (c) 2015年 Apple -11. All rights reserved.
//

#import "NetWork.h"

@implementation NetWork
+(BOOL)checkNetworkState{
    //检查wifi
    Reachability *wifi=[Reachability reachabilityForLocalWiFi];
    //检查手机是否可以上网
    Reachability *conn =[Reachability reachabilityForInternetConnection];
    
    if ([wifi currentReachabilityStatus]!=NotReachable) {
        NSLog(@"wifi");
        return YES;
    }else if ([conn currentReachabilityStatus]!=NotReachable){
        NSLog(@"移动数据");
        return YES;
    }else{
        return NO;
    }
}
@end
